package org.suyafei.listener;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.suyafei.model.EventMessage;

import java.io.IOException;


/**
 * @author 宿某人
 * @Date: 2022/01/24/3:07 下午
 * @Description:
 */
@Component
@Slf4j
//@RabbitListener(queues = "short_link.add.link.queue")
@RabbitListener(queuesToDeclare = {@Queue("traffic.error.queue")})
public class TrafficErrorMQListener {


    @RabbitHandler
    public void shortLinkHandler(EventMessage eventMessage, Message message, Channel channel) throws IOException {
        log.info("告警：监听到TrafficErrorMQListener message消息内容:{}", eventMessage);
        log.info("告警：Message{}", message);
        log.info("告警成功发送通知短信");
    }
}
